-
-
Notifications
You must be signed in to change notification settings - Fork 24
Add SubtractSaturating extension method for TimeSpan #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
…ests Co-authored-by: niemyjski <[email protected]>
return new AgeSpan(span); | ||
} | ||
|
||
public static TimeSpan SubtractSaturating(this TimeSpan self, TimeSpan other) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot add xml documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comprehensive XML documentation to the SubtractSaturating method following the project's documentation standards. The documentation includes a summary, parameter descriptions, and return value description. Commit: 91c1ff8
} | ||
|
||
[Fact] | ||
public void SubtractSaturating() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot follow my best practices for test naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored the test to follow the MethodName_StateUnderTest_ExpectedBehavior naming convention as specified in the testing guidelines. Split the single monolithic test into 8 focused test methods, each testing a specific scenario with descriptive names and proper AAA structure. Commit: aef0ed9
Co-authored-by: niemyjski <[email protected]>
…ention Co-authored-by: niemyjski <[email protected]>
Implemented SubtractSaturating method for TimeSpan extensions with comprehensive testing and XML documentation.
The SubtractSaturating method subtracts one TimeSpan from another and ensures the result doesn't go below TimeSpan.Zero. This implements saturating arithmetic for TimeSpan subtraction, preventing negative results.
Key features:
Fixes #43.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.